package com.IO;

import java.io.*;


public class TestBuffered {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        try (
            BufferedInputStream bis = new BufferedInputStream(new FileInputStream("E:\\Pictures\\akali.jpg"));
            BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("E:\\testFile\\copyakali2.jpg"));
        ){
            int len;
            byte[] b = new byte[1024];
            while ((len=bis.read(b))!=-1){
                bos.write(b,0,len);
            }
            bis.close();
            bos.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        long end = System.currentTimeMillis();
        System.out.println("缓冲流的复制时间:"+(end-start));

    }
}

    